ALTER TABLE StockInOutType ADD CorporationCode NVARCHAR(20)

alter table StockInOutType
   add constraint FK_Corporation_StockInOutType foreign key (CorporationCode)
      references Corporation (Code)
GO

alter table StockIn
   add constraint FK_StockInOutType_StockIn foreign key (Type)
      references StockInOutType (ID)
go